package com.kedou.sdk.params.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.kedou.sdk.utils.WL;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2017/6/12 0012.
 */

public final class NavModel implements Parcelable {

    private String name;
    private String url;
    private String icon_nchecked;
    private String icon_select;
    private int is_default;
    private String iden_name;

    public NavModel() {

    }

    public String getIden_name() {
        return iden_name;
    }

    public void setIden_name(String iden_name) {
        this.iden_name = iden_name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getIcon_nchecked() {
        return icon_nchecked;
    }

    public void setIcon_nchecked(String icon_nchecked) {
        this.icon_nchecked = icon_nchecked;
    }

    public String getIcon_select() {
        return icon_select;
    }

    public void setIcon_select(String icon_select) {
        this.icon_select = icon_select;
    }

    public int getIs_default() {
        return is_default;
    }

    public void setIs_default(int is_default) {
        this.is_default = is_default;
    }

    protected NavModel(Parcel in) {
        name = in.readString();
        url = in.readString();
        icon_nchecked = in.readString();
        icon_select = in.readString();
        is_default = in.readInt();
        iden_name = in.readString();
    }

    public static final Creator<NavModel> CREATOR = new Creator<NavModel>() {
        @Override
        public NavModel createFromParcel(Parcel in) {
            return new NavModel(in);
        }

        @Override
        public NavModel[] newArray(int size) {
            return new NavModel[size];
        }
    };

    @Override
    public String toString() {
        JSONObject json = new JSONObject();
        try {
            json.put("name", name);
            json.put("url", url);
            json.put("is_default", is_default);
        } catch (JSONException e) {
            WL.e("LoginInfo", "JSONException --->");
        }
        return json.toString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
        dest.writeString(url);
        dest.writeString(icon_nchecked);
        dest.writeString(icon_select);
        dest.writeInt(is_default);
        dest.writeString(iden_name);
    }
}
